package com.zxy.study.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.widget.TextView;

import com.zxy.study.R;
import com.zxy.study.utils.Utils;
import com.zxy.study.adapter.TextAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MoveTextToTitleActivity extends Activity {

	@BindView(R.id.tv_title)
	TextView mTvTitle;

	@BindView(R.id.tv_name)
	TextView mTvName;
	@BindView(R.id.tv_desc)
	TextView mTvDesc;

	@BindView(R.id.recyclerview)
	RecyclerView mRecyclerView;

	//	@BindView(R.id.vp)
	//	ViewPager mVp;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_move_text_to_title);
		ButterKnife.bind(this);

		initView();
	}

	private void initView() {
		mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
		TextAdapter adapter = new TextAdapter(Utils.getTestData("嵌套滑动"));
		mRecyclerView.setAdapter(adapter);

		//		mVp.setAdapter(new PagerAdapter() {
		//			@Override
		//			public int getCount() {
		//				return 3;
		//			}
		//
		//			@Override
		//			public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
		//				return view == object;
		//			}
		//
		//			@NonNull
		//			@Override
		//			public Object instantiateItem(@NonNull ViewGroup container, int position) {
		//				RecyclerView recyclerView = new RecyclerView(MoveTextToTitleActivity.this);
		//				recyclerView.setLayoutManager(new LinearLayoutManager(MoveTextToTitleActivity.this, LinearLayoutManager.VERTICAL, false));
		//				TextAdapter adapter = new TextAdapter(Utils.getTestData("嵌套滑动"));
		//				recyclerView.setAdapter(adapter);
		//				container.addView(recyclerView);
		//				return recyclerView;
		//			}
		//
		//			@Override
		//			public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
		//				//				super.destroyItem(container, position, object);
		//				container.removeView((View) object);
		//			}
		//		});
	}

}
